﻿/**
作者：常亮
时间：2009-11-18
功能：登录页代码
**/
var time, DisplayName;
function ShowMain() {
    time = ShowTime();
    var url = encodeURI(SBasePath + '/action/Top.aspx');
    var pars = encodeURI("");
    var myAjax = new Ajax.Request(url, { method: 'get', parameters: pars, onComplete: sGetProductAppli, onFailure: fGetProductAppli });
}
//调用登录人真实姓名
function sGetProductAppli(o) {
    var root = o.responseXML.documentElement;
    DisplayName = GetXmlData(root, "DisplayName");
    ShowContent();
}

function fGetProductAppli() { 

}
//后退
function Back() {
    history.back();
}
//前进
function Next() {
    window.history.forward();
}
//刷新
function Reload() {
    window.top.frames["Content"].location.reload();
}
//首页
function Home() {
    window.top.frames["Content"].location.href = "action/Home.aspx";
}
//个人信息修改
function UserEdit() {
    window.top.frames["Content"].location.href = "htm/UsersManage/UserEdit.htm";
}
//退出
function CloseWeb() {
    var url = encodeURI(SBasePath + '/action/CloseWeb.aspx');
    var pars = encodeURI("");
    var myAjax = new Ajax.Request(url, { method: 'get', parameters: pars, onComplete: sGetProductCloseWeb, onFailure: fGetProductCloseWeb });
 }
//退出成功，并返回到登录页
 function sGetProductCloseWeb(o) {
     var root = o.responseXML.documentElement;
     var value = GetXmlData(root, "Value");
     if (value == "True") {
         window.parent.location.href = "login.htm"
     }
 }

 function fGetProductCloseWeb() {

 }
 
function ShowContent() {
var str = '';
    str+='<table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed;">';
    str+='    <tr>';
    str+='        <td height="9" style="line-height: 9px; background-image: url(images/main_04.gif)">';
    str+='            <table width="100%" border="0" cellspacing="0" cellpadding="0">';
    str+='                <tr>';
    str+='                    <td width="97" height="9" background="images/main_01.gif"> &nbsp; </td>';
    str+='                    <td>&nbsp;</td>';
    str+='                    <td> &nbsp;</td>';
    str+='                </tr>';
    str+='            </table>';
    str+='        </td>';
    str+='    </tr>';
    str+='     <tr>';
    str+='        <td height="47" background="images/main_09.gif">';
    str+='            <table width="100%" border="0" cellspacing="0" cellpadding="0">';
    str+='                <tr>';
    str+='                    <td width="38" height="47" background="images/main_06.gif"> &nbsp;</td>';
    str+='                    <td width="59">';
    str+='                        <table width="100%" border="0" cellspacing="0" cellpadding="0">';
    str+='                            <tr>';
    str+='                                <td height="29" background="images/main_07.gif">&nbsp;</td>';
    str+='                            </tr>';
    str+='                            <tr>';
    str+='                                <td height="18">';
    str+='                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed;">';
    str+='                                        <tr>';
    str+='                                            <td width="60px" border="0">';
    str += '                                                <span class="f_green">' + DisplayName + '</span>';
    str+='                                            </td>';
    str+='                                        </tr>';
    str+='                                    </table>';
    str+='                                </td>';
    str+='                            </tr>';
    str+='                        </table>';
    str+='                    </td>';
    str+='                    <td width="155" background="images/main_08.gif">&nbsp;</td>';
    str+='                    <td>';
    str+='                        <table width="100%" border="0" cellspacing="0" cellpadding="0">';
    str+='                            <tr>';
    str+='                                <td height="23" valign="bottom">';
    str += '                                  <a href="#" onclick="Home()"><img border="0" src="images/sy.gif" /></a>';
    str+='<a href="#" onclick="Back()"><img border="0" src="images/ht.gif" /></a>';
    str+='<a href="#" onclick="Next()"><img src="images/qj.gif" border="0" /></a>';
    str+='<a href="#" onclick="Reload()"><img src="images/sx.gif" border="0" /></a>';
    str += '<a href="#" onclick="UserEdit()"><img src="images/xg.gif" border="0" /></a>';
    str+= '                                    <a href="#" onclick="CloseWeb()"><img src="images/tc.gif" border="0" /></a>';
    str+='                                </td>';
    str+='                            </tr>';
    str+='                        </table>';
    str+='                    </td>';
    str+='                    <td width="200" background="images/main_11.gif">';
    str+='                        <table width="100%" border="0" cellspacing="0" cellpadding="0">';
    str+='                            <tr>';
    str+='                                <td width="11%" height="23">&nbsp;</td>';
    str+= '                                <td width="89%" valign="bottom">';
    str+='                                    <span class="f_green">日期:'+time+'</span>';
    str+='                                </td>';
    str+='                            </tr>';
    str+='                        </table>';
    str+='                    </td>';
    str+='                </tr>';
    str+='            </table>';
    str+='        </td>';
    str+='    </tr>';
    str+='   <tr>';
    str+='        <td height="5" style="line-height: 5px; background-image: url(images/main_18.gif)">';
    str+='            <table width="100%" border="0" cellspacing="0" cellpadding="0">';
    str+='                <tr>';
    str+='                    <td width="180" background="images/main_16.gif" style="line-height: 5px;">&nbsp;</td>';
    str+='                    <td>&nbsp;</td>';
    str+='                </tr>';
    str+='            </table>';
    str+='        </td>';
    str+='   </tr>';
    str += '</table>';
    $("Top").innerHTML = str;
}
